package com.css.zfzx.sjcj.modules.hddcB5_GeophySvyDataTable.repository;

import com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository.entity.HddcA1InvrgnhasmaterialtableEntity;
import com.css.zfzx.sjcj.modules.hddcB5_GeophySvyDataTable.repository.entity.HddcB5GeophysvydatatableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zhangcong
 * @date 2020-11-28
 */
public interface HddcB5GeophysvydatatableRepository extends JpaRepository<HddcB5GeophysvydatatableEntity, String> {
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b5_geophysvydatatable set qualityinspection_status=:s ,extends1=:str where uuid=:uuid")
    void updateStatus(String s, String str, String uuid);
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b5_geophysvydatatable set qualityinspection_status=:s ,extends2=:str where uuid=:uuid")
    void update2Status(String s, String str, String uuid);

    @Query(nativeQuery = true,value = "select * from hddc_b5_geophysvydatatable where is_valid=1 and extends10=1 ")
    List<HddcB5GeophysvydatatableEntity> findByAll();

    HddcB5GeophysvydatatableEntity findBySvypointidAndIsValid(String id, String isValid);

    HddcB5GeophysvydatatableEntity findByUuidAndIsValid(String id, String isValid);
}
